QNW_TS_ServerOther = QNW_TS_ServerOther or {}

function QNW_TS_ServerOther.addZombie(_player, _x, _y, _z, _count, _type)
    if not _count then
        _count = 1
    end
    local list = addZombiesInOutfit(_x, _y, _z, _count, nil, 50)
    if _type and _type == 1 then
        for i = 0, list:size() - 1 do
            local zombie = list:get(i)
            zombie:setWalkType("sprint1")
            zombie:pathToCharacter(_player)
        end
    end
end

function QNW_TS_ServerOther.SearchAndDestory(_player, _x, _y, _z, _count, _type)
    if not _count then
        _count = 1
    end
    local list = addZombiesInOutfit(_x, _y, _z, _count, nil, 50)
    if _type and _type == 1 then
        for i = 0, list:size() - 1 do
            local zombie = list:get(i)
            if i <= 1 then
                zombie:setHealth(26)
                zombie:setWalkType("sprint1")
            else
                zombie:setHealth(260)
            end
            print("done")
            zombie:pathToCharacter(_player)
        end
    end
end

function QNW_TS_ServerOther.randomReward(_player, _uuid, _type, _count)
    local rewards = QNW_TS_RewardPool[_type]:randomWeight(_count)
    local list = {}
    for k, v in pairs(rewards) do
        table.insert(list, v:save())
    end
    QNW_TS_ServerCommand.sendReward(_uuid, list, _player)
end

function QNW_TS_ServerOther.randomRewardDange(_player, _type, _count)
    local rewards = QNW_TS_RewardPool[_type]:randomWeight(_count)
    local list = {}
    for k, v in pairs(rewards) do
        table.insert(list, v:save())
    end
    QNW_TS_ServerCommand.sendRewardDanger(list, _player)
end
